﻿using System;
using System.Drawing;
using System.Drawing.Win32;

namespace HoldemHook
{
    public class TextOutEventArgs : EventArgs
    {
        public DateTime InTime;
        public string Message;
        public PointF Point;
        public WinWnd Window;

        public TextOutEventArgs(WinWnd wnd, PointF pt, string msg, DateTime dt)
        {
            Message = msg;
            InTime = dt;
            Window = wnd;
            Point = pt;
        }
    }

    [Serializable]
    public class CallEventArgs : EventArgs
    {
        public string DLL;

        public string Function;
        public object[] Args;
        public object RetVal;

        public Int32 Process;
        public Int32 Window;

        public DateTime InTime;

        public CallEventArgs(string function, object retval, params object[] args)
        {
            Function = function;
            Args = args;
            RetVal = retval;
            InTime = DateTime.Now;
        }

        public override string ToString()
        {
            string sArgs = "";
            for (int i = 0; i < Args.Length; i++)
            {
                if (i > 0)
                    sArgs = sArgs + ", ";
                sArgs = sArgs + Args[i];
            }
            return String.Format("{0}({1}) returns {2}", Function, sArgs, RetVal);
        }
    }

    public enum WindowEventType
    {
        Add,
        Remove,
        Reset
    }

    [Serializable]
    public class WindowEventArgs : EventArgs
    {
        public Int32 Process;
        public WindowEventType Type;
        public WinWnd Wnd;
        public EnumWindowsCollection Windows;

        public WindowEventArgs(WindowEventType type, Int32 process, WinWnd wnd, EnumWindowsCollection coll)
        {
            Process = process;
            Wnd = wnd;
            Windows = coll;
            Type = type;
        }
    }

    [Serializable]
    public class GUINodeEventArgs : EventArgs
    {
        public GUINode Node;

        public GUINodeEventArgs(GUINode node)
        {
            Node = node;
        }
    }
}